<%@ page contentType="text/html;charset=utf-8"%>
<%@ page
	import="java.io.*, java.sql.*, java.util.*, java.text.*, napal.*, util.*, napal.*"%>
<%@ page import="org.apache.ibatis.*"%>
<%@ page import="java.util.Date"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="my" %>
<%
	request.setCharacterEncoding("utf-8");
String name = request.getParameter("searchname");
int currentPage = 1, pageSize = 10;
String spg = request.getParameter("pg");
if (spg != null) currentPage = Integer.parseInt(spg);
%>


<%@ include file="./Header.jsp"%></td>
</TR>
<TR HEIGHT="100"> 
<TD>
<a href="OverdueCheck.jsp" class="btn btn-link btn-small">사용자연체조회<br></a><br><br>
<p align="right">
			<Table>
				<Tr>
					<td></td>
					<td>
							<form method="POST">
								<input type="text" name="searchname" placeholder="이름검색">
								<input name="cmd1"
									type="submit" class="btn btn-inverse" value="search"></form>

							</td>
				</Tr>
			</Table>
			</p>
			<%
				if ("search".equals(request.getParameter("cmd1"))) {
			%>
			<table class="table" width="100%">
				<Tr>
					<td>카테고리명</td>
					<td>모델명</td>
					<td>기자재관리번호</td>
					<td>보관사용처</td>
					<td>대여기간</td>
					<td>대여분류</td>
					<td>학과이름</td>
					<td>이름</td>
					<td>학번</td>
					<td>연락처</td>
					<td>연체기간</td>
				</Tr>
				<%
					for (Return r : RentalHome.OverdueCheckName(name)) {
				%>
				<TR>
						<td><%=r.get카테고리명()%></td>
						<td><%=r.get모델명()%></td>
						<td><%=r.get기자재관리번호() %></td>
						<td><%=r.get보관사용처() %></td>
						<td><%=r.get대여기간()%></td>
						<td><%=r.get대여분류()%></td>
						<td><%=r.get학과이름()%></td>
						<td><%=r.get이름()%></td>
						<Td><%=r.get학번()%></td>
						<td><%=r.get연락처()%></td>
						<td><%=r.get연체기간() %></td>
				</TR>
				<%
					}
				%>
			</table>
				<%
					} 
				else{
				%>
<table class="table" width="100%">
				<Tr>
					<td>카테고리명</td>
					<td>모델명</td>
					<td>기자재관리번호</td>
					<td>보관사용처</td>
					<td>대여기간</td>
					<td>대여분류</td>
					<td>학과이름</td>
					<td>이름</td>
					<td>학번</td>
					<td>연락처</td>
					<td>연체기간</td>
				</Tr>
				<%
					//for (Return r : RentalHome.OverdueCheck()) {
						 for (Return r : RentalHome.selectPageOverdue(currentPage, pageSize)) { %>
				
				<TR>
						<td><%=r.get카테고리명()%></td>
						<td><%=r.get모델명()%></td>
						<td><%=r.get기자재관리번호() %></td>
						<td><%=r.get보관사용처() %></td>
						<td><%=r.get대여기간()%></td>
						<td><%=r.get대여분류()%></td>
						<td><%=r.get학과이름()%></td>
						<td><%=r.get이름()%></td>
						<Td><%=r.get학번()%></td>
						<td><%=r.get연락처()%></td>
						<td><%=r.get연체기간() %></td>
				</TR>
				<%
					}
				%>
			</table>
			<p align="center">	<my:pager2 pageSize="<%= pageSize %>" recordCount="<%= RentalHome.selectCountOverdue() %>"/></p>
			<%} %>





	</td>
</TR>

<TR HEIGHT="50">
<TD><%@ include file="./bottom.jsp"%></TD> 
</TR>
</TABLE>

</body>
</html>